﻿namespace EzDesk.DevHelper.DbMgr.FeedStudio.ToEzLanguage
{
    public class BasicInfoProcessor : EzMLProcessor
    {
        readonly string _sectionName;

        public BasicInfoProcessor(string sectionName)
        {
            this._sectionName = sectionName;
        }

        public override string Process(string input)
        {
            string prefix = string.Format(
                "<ez:root xmlns:ez=\"http://www.codeplex.com/ezdeskdev\"  section=\"{0}\">",
                _sectionName
                );
            string suffix = "</ez:root>";

            var output = input.Trim();

            output = output.Remove(0, prefix.Length);
            output = output.Remove(output.Length - suffix.Length, suffix.Length);

            return output;


        }
    }
}
